package org.nekperu15739.aboutme.business.service.menu;

import java.util.ArrayList;
import java.util.List;

import nekperu15739.me.business.dto.menu.Menu;
import nekperu15739.me.business.dto.menu.MenuItem;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

//@Service
public class MenuService {

    @Autowired
    private Menu menu;

    private List<MenuItem> menuItemList;

    public MenuService() {
        super();
        menuItemList = new ArrayList<MenuItem>();
    }

    public Menu loadMenu() {
        menuItemList.add(new MenuItem("inicio", "/index"));
        menuItemList.add(new MenuItem("cv", "/cv"));
        menuItemList.add(new MenuItem("blog", "/blog"));
        menuItemList.add(new MenuItem("enlaces", "/links"));
        menuItemList.add(new MenuItem("contacto", "/contact"));
        menu.setMenuItemList(menuItemList);

        return menu;
    }

    public Menu loadMenuByLanguaje(String language) {
        if (language.equalsIgnoreCase("en")) {
            menuItemList.add(new MenuItem("init", "/index"));
            menuItemList.add(new MenuItem("cv", "/cv"));
            menuItemList.add(new MenuItem("blog", "/blog"));
            menuItemList.add(new MenuItem("links", "/links"));
            menuItemList.add(new MenuItem("contacts", "/contact"));
            menu.setMenuItemList(menuItemList);
        } else {
            menu = loadMenu();
        }
        return menu;
    }
}
